package com.jintian.hnsj_metting.api

import com.hjq.http.EasyHttp
import com.hjq.http.config.IRequestApi
import com.hjq.http.listener.HttpCallbackProxy
import com.jintian.hnsj_metting.BaseActivity
import com.jintian.hnsj_metting.api.bean.MeetingPageVO
import com.jintian.hnsj_metting.api.bean.RoomPageVO
import com.jintian.hnsj_metting.util.DeviceInfo


class MeetingApi {
    companion object {
        fun getMeetingList(
            activity: BaseActivity,
            listener: HttpCallbackProxy<HttpData<List<MeetingPageVO>>>
        ) {
            EasyHttp.get(activity)
                .api(MeetingListApi())
                .request(listener)
        }

        fun getMeetingRoom(
            activity: BaseActivity,
            listener: HttpCallbackProxy<HttpData<RoomPageVO>>
        ) {
            EasyHttp.get(activity)
                .api(MeetingRoomApi())
                .request(listener)
        }
    }

    class MeetingListApi : IRequestApi {

        override fun getApi(): String {
            return "device/hik/meeting/query-list/${DeviceInfo.getSN()}/${DeviceInfo.getOtherIds()}"
        }
    }

    class MeetingRoomApi : IRequestApi {

        override fun getApi(): String {
            return "device/hik/meeting/room/${DeviceInfo.getSN()}";
        }
    }
}